package 算法.leetcode.bytedance;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;

/**
 * @author lchenglong
 * @date 2022/5/7
 */
public class OfferString_V {
    public String reverseWords(String s) {
        s = s.trim();
        String[] array = s.split("\\s+");
        List<String> words = Arrays.asList(array);
        Collections.reverse(words);
        return String.join(" ",words);
    }
}
